package com.it.gw.modules.station.activity

import android.util.Log
import com.it.common.utils.GlideUtils
import com.it.common.utils.isNotEmpty
import com.it.gw.R
import com.it.gw.base.BaseActivity
import com.it.gw.databinding.ActivityPhotoViewBinding

class PhotoViewActivity : BaseActivity<ActivityPhotoViewBinding>() {
    companion object{
        const val TAG = "PhotoViewActivity"
    }
    override fun initObserver() {

    }

    override fun initListener() {

    }

    override fun initData() {

    }

    override fun initView() {
        setTitle(
            title = R.string.str_photo_see,
            isBack = true,

            )
        val filePath = intent.getStringExtra("filePath")
        val url = intent.getStringExtra("url")
        Log.d(TAG, "initView: $filePath $url")
        if (filePath.isNotEmpty()) {
            GlideUtils.loadFile(this, filePath!!, binding.photoView)
        } else {
            GlideUtils.loadNet(this, url!!, binding.photoView)
        }

    }

    override fun setContentView() {
        binding = ActivityPhotoViewBinding.inflate(layoutInflater)
        setContentView(binding.root)
    }
}